<?php 
define ( 'IN_UCHOME', '1' );
define('API_SCRIPT','api.php');
include_once '../common.php';
include_once './apishow-common.php';

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片批量上传</title>
<script type="text/javascript">
	var baseUrl = './uploadify';
</script>

<link rel="stylesheet" href="./css.css" type="text/css" />

<link rel="stylesheet" href="./uploadify/uploadify.css" type="text/css" />

<link rel="stylesheet" href="./ui/jquery-ui.css" type="text/css" />
<style type="text/css">
#wrapper{padding:8px;}
#uploadFileDiv {
	position: relative;
	height: 80px;
}

#fileQueue {
	position: absolute;
	height: 60px;
	width: 500px;
	left: 160px;
	top: 0;
	overflow: hidden;
}
</style>
<!-- Our CSS stylesheet file -->
<link rel="stylesheet" href="html5-drag-and-drop/css/styles.css" />

<!--[if lt IE 9]>
          <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
</head>
<body>


	<div id="wrapper">

		<div id="loginBox"
			style="text-align: left; width: 99%; margin: 0 auto;">
			<h1>图片上传<a href="index.php" target="_blank" style="padding: 0 20px;font-size:14px;font-weight:normal;line-height:25px;color:#0000EE;text-decoration:none;">浏览图片</a></h1>
			<div id="msg"
				style="margin: 5px; font-size: 13px; color: red; ">
			</div>
			<div id="dropbox">
				<span class="message">Drop images here to upload. <br />
				<i>(they will only be visible to you)</i></span>
			</div>
			<textarea id="html5" name="elm5" rows="5" cols="80"
				style="width: 100%; display: none;">
			&lt;p&gt;xhEditor编辑器，HTML5批量上传图片功能。&lt;/p&gt;
			&lt;p&gt;只要将图片拖入这个窗口，即可实现多张图片上传！马上体验吧！！&lt;/p&gt;
			</textarea>
			<div style="margin-top: 5px; margin-left: 5px; font-size: 13px;">
				<div id="uploadFileDiv" title="images upload">

					<div style="width: 150px; float: left; padding-top: 16px;">
						<input type="file" id="uploadify" class="half" value=""
							name="uploadify" style="display: none;" />
					</div>

					<div id="fileQueue"></div>

				</div>
			</div>
			<div align="left" id="imagesDiv">
			
			
			<div style='clear: both;'>&nbsp;</div>
			</div>
		</div>
		<form action="../<?php echo API_SCRIPT;?>" method="post" enctype="multipart/form-data"
			style="display: none;">

			<input type="file" name="_file" /> <input name="f" value="upload"
				type="hidden" /> <input name="e" value="280859158@qq.com"
				type="hidden" /> <input name="p" value="upload" type="hidden" /> <input
				type="submit" name="submit" value='submit' />
		</form>


	</div>
</body>

<script type="text/javascript" src="./uploadify/jquery.min.js"></script>

<script type="text/javascript" src="./fancybox/jquery.fancybox.pack.js"></script>
<link rel="stylesheet" type="text/css"	href="./fancybox/jquery.fancybox.css" media="screen" />
<link rel="stylesheet" type="text/css"	href="./fancybox/jquery.fancybox-thumbs.css" />
<script type="text/javascript"	src="./fancybox/jquery.fancybox-thumbs.js"></script>

<script>
$(function(){
	$('.fancybox').fancybox({
		prevEffect	: 'none',
		nextEffect	: 'none',
		loop : true,		
		helpers	: {
			title	: {
				type: 'outside'
			},
			overlay	: {
				opacity : 0.8,
				css : {
					'background-color' : '#000'
				}
			},
			thumbs	: {
				width	: 50,
				height	: 50
			}
		}
	});	
	
});
</script>
<script type="text/javascript" src="./ui/jquery-ui.js"></script>
<script type="text/javascript" SRC="./uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" SRC="./uploadify/swfobject.js"></script>
<script>
var uploadify_data = {"f":"uploadify","e":"<?php echo $user['email']?>","p":"<?php echo $user['pwmd5']?>"};
var script = '../<?php echo API_SCRIPT;?>';
function thumbShow(thumb,src){
	$("#imagesDiv").prepend("<div class='imgWrap'><a href='"+src+"' class='fancybox'  data-fancybox-group='gallery'><img src='" + thumb+  "'/></a></div>");
}
</script>
<script type="text/javascript" SRC="./uploadify/picture.upload.js"></script>

<script type="text/javascript"
	src="./xheditor/xheditor-1.1.13-zh-cn.min.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{	
	$.extend(xheditor.settings);
	//$('#html5').xheditor({tools:'Fullscreen',upLinkUrl:"../<?php echo API_SCRIPT;?>?f=upload",upLinkExt:"zip,rar,txt",upImgUrl:"../<?php echo API_SCRIPT;?>?f=xheditor",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"../<?php echo API_SCRIPT;?>?f=xheditor",upFlashExt:"swf,flv",upMediaUrl:"../<?php echo API_SCRIPT;?>?f=xheditor",upMediaExt:"mp3",onUpload:insertUpload});
	$('#html5').xheditor({tools:'Fullscreen',upImgUrl:"../<?php echo API_SCRIPT;?>?f=xheditor&e=<?php echo $user['email']?>&p=<?php echo $user['pwmd5']?>",upImgExt:"jpg,jpeg,gif,png",onUpload:insertUpload});
	
}
function insertUpload(arrMsg)
{
	var i,msg;
	for(i=0;i<arrMsg.length;i++)
	{
		//alert(arrMsg[i]);

		thumbShow(arrMsg[i].thumb,arrMsg[i].url);
		//$("#imagesDiv").prepend("<div class='imgWrap'><img src='" + arrMsg[i].thumb+  "'/></div>");
	}
}
</script>

<!-- Including the HTML5 Uploader plugin -->
<script src="html5-drag-and-drop/js/jquery.filedrop.js"></script>

<!-- The main script file -->
<script>
var drag_drop_url = "../<?php echo API_SCRIPT;?>?f=drag-drop&e=<?php echo $user['email']?>&p=<?php echo $user['pwmd5']?>";

</script>
<script src="html5-drag-and-drop/js/script.js"></script>


</html>